package com.cn.stusy0015.demo0020;



/**
 * @author lw
 * @ClassName StudentPd.java
 * @Description
 * @createTime 2023年05月21日 15:57:00
 */
public class StudentPd {
    Student[] s =  new Student[20];
    public void addStu(Student stu){
        for (int i = 0; i < s.length; i++) {
            if (s[i] == null) {
                s[i] = stu;
                break;
            }
        }
    }
    /**
     * 登录验证
     */
    public boolean loginVerify(String sname, String spassword) {
        boolean res = false;
        for (int i = 0; i < s.length; i++) {
            if (s[i] != null && s[i].getSname().equals(sname) && s[i].getSpassword().equals(spassword)) {
                res = true;
            }
        }
        return res;
    }

}
